var count = 0;

function updateCount() {
  return count++;
}

function render(count, elem) {
    var elem = elem || document.getElementById('app')
    elem.innerHTML = 'current count is ' + count;
}

render(updateCount());
setInterval(function () {
  render(updateCount());
}, 1000);